//
//  UIView+Main.m
//  DayToDo
//
//  Created by karry on 2021/1/29.
//

#import "UIView+Main.h"

@implementation UIView (Main)

- (void)setAnchorPoint:(CGPoint)anchorPoint forView:(UIView *)view
{
    CGPoint oldOrigin = view.frame.origin;
    view.layer.anchorPoint = anchorPoint;
    CGPoint newOrigin = view.frame.origin;
 
    CGPoint transition;
    transition.x = newOrigin.x - oldOrigin.x;
    transition.y = newOrigin.y - oldOrigin.y;
 
    view.center = CGPointMake (view.center.x - transition.x, view.center.y - transition.y);
}

- (void)us_makeAlert:(NSString *)title subTitle:(NSString *)subTitle{
    
    MOAlertBaseView *alert = [[MOAlertBaseView alloc]initWithTitle:title detailTitle:subTitle contentView:nil leftButtonImageName:@" " rightButtonImageName:nil autoDissmiss:YES tapDissmiss:YES];
    
    [alert show];
    
}

- (void)us_addShadow{
    [self jk_shadowWithColor:UIColor.mi_3_color offset:CGSizeMake(2, 2) opacity:0.5 radius:3];
}

@end
